home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2912 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  708 b 

  1. Path: news.itd.umich.edu!usenet
  2. From: Chris Lahey <clahey@umich.edu>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Fastest way to computer log(base2) of x?
  5. Date: 24 Jan 1996 22:56:31 GMT
  6. Organization: University of Michigan
  7. Message-ID: <4e6dev$ksl@lastactionhero.rs.itd.umich.edu>
  8. References: <4e61iu$p6e@villa.fc.net>
  9. NNTP-Posting-Host: rep00703.reshall.umich.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.12 (X11; I; Linux 1.2.13 i586)
  14. X-URL: news:4e61iu$p6e@villa.fc.net
  15.  
  16. Depending on the speed of your FPU doing (int) log((double)x) / log(2.0) might
  17. be faster than checking each digit.  I have absolutely no idea which is faster.
  18.      Chris
  19.  
  20.